package com.hukun.clazz;


//多层继承 不支持多重继承
public class 秦 extends BYDCar{


private  String  charge;



    public 秦(String brand) {
        super(brand);
    }

    public String getCharge() {
        return charge;
    }

    //封装性最大的好处就是在封装方法里可以添加逻辑
    public void setCharge(String charge) {

        if(!charge.startsWith("BYd"))

        {
            System.out.println("电池不匹配");
            return;
        }

        this.charge = charge;
    }

    @Override
    public String toString() {
        return "秦{" +
                "charge='" + charge + '\'' +
                '}';
    }


}

